#include "player.h"

#include <iostream>
#include "xmlhelpers.h"

Player::Player (TickableList * tList) : Moveable(tList) {
}

Player::~Player () {
}

void Player::HandleWallStrike () {
}

void Player::LoadConfig (rapidxml::xml_document<> & xml) {
	rapidxml::xml_node<> * node = XMLGetNode(xml, XML_PLAYER_NODE);

	std::string tmp;
	XMLGetValue(tmp, node, "texture");
	texture.Load(tmp);
	
	XMLGetValue(speed, node, "speed");
	XMLGetValue(digSpeed, node, "digSpeed");
	XMLGetValue(digDamage, node, "digDamage");
	LoadAnimation(XMLGetNode(node, "animation"));
}

void Player::Draw (SDL_Surface * screen, unsigned int timestamp) {
	SDL_Rect dst;
	SDL_Rect src;
	GetDefaultDstRect(dst);
	GetDefaultSrcRect(src, timestamp);
	texture.Draw(screen, dst, src);
}
